<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>22-表单域修饰符</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <style></style>
  </head>
  <body>
    <div id="app">
      数字：<input type="text" v-model.number="num" /><br />
      change: <input type="text" v-model.lazy="info" /><br />
      trim: <input type="text" v-model.trim="msg" />
      <br />
      <button class="btn" @click="btn">点击</button>
    </div>
    <script>
      var vm = new Vue({
        el: '#app',
        data: {
          num: 1,
          info: '2',
          msg: '3',
        },
        methods: {
          btn: function () {
            console.log(this.num + 8);
            console.log(this.info.length);
          },
        },
      });
    </script>
  </body>
</html>
